package com.finesys.backend.common.constant;

/**
 * <p>Title: 业务操作结果定义</p>
 * <p>Description: </p>
 * <p>Copyright: CopyRight (c) 2020-2035</p>
 * <p>Company: finesys Co. LTD.</p>
 * <p>Author: lehoon</p>
 * <p>Date: 2021/2/5 9:53</p>
 */
public enum BusinessCode {
    SUCCESS(200, "操作成功"),

    RESOURCE_NOT_EXIST(4000, "资源不存在,操作失败"),
    RESOURCE_IS_EXIST(4001, "资源已经存在,添加失败"),
    BAD_REQUEST(4000, "请求参数错误"),
    MISSING_REQUEST(4000, "缺少请求参数"),

    //认证操作码
    AUTH_NOTVALID_TOKEN(5000, "非法的toekn,签名错误"),
    AUTH_USER_NOT_EXIST(5001, "用户不存在"),
    AUTH_UNAUTHORIZED(5002, "用户名或密码错误"),
    AUTH_TIMEOUT(5003, "登陆超时，请重新登录"),


    SYSTEM_EXCEPTION(6000, "系统内部错误,操作失败"),
    SYSTEM_DATABASE_EXCEPTION(6001, "数据库系统错误,操作失败"),

    SERVICE_UNAVAILABLE(9999, "当前服务不可用,请稍后重试");

    //结构
    private Integer code;
    //消息
    private String  message;

    BusinessCode(Integer code, String message) {
        this.code = code;
        this.message = message;
    }


    public Integer getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }
}
